package com.getpebble.android.common.model;

import java.util.HashMap;
import java.util.Map;

public enum PebbleColor {
    COLOR_UNKNOWN(0),
    COLOR_BLACK(1),
    COLOR_WHITE(2),
    COLOR_RED(3),
    COLOR_ORANGE(4),
    COLOR_GRAY(5),
    COLOR_BIANCA_SILVER(6),
    COLOR_BIANCA_BLACK(7),
    COLOR_TINTIN_BLUE(8),
    COLOR_TINTIN_GREEN(9),
    COLOR_TINTIN_PINK(10);
    
    private static final Map<Integer, PebbleColor> intToTypeMap = null;
    private final int mValue;

    static {
        intToTypeMap = new HashMap();
        for (PebbleColor type : values()) {
            intToTypeMap.put(Integer.valueOf(type.mValue), type);
        }
    }

    public static PebbleColor fromInt(int i) {
        PebbleColor type = (PebbleColor) intToTypeMap.get(Integer.valueOf(i));
        if (type == null) {
            return COLOR_UNKNOWN;
        }
        return type;
    }

    public int getIntValue() {
        return this.mValue;
    }

    private PebbleColor(int value) {
        this.mValue = value;
    }
}
